package com.dp.mallchat.common.common.utils;

import com.dp.mallchat.common.common.domain.dto.RequestInfo;

/**
 * @Author: dupeng
 * @CreateTime: 2024-06-03  15:38
 * @Description: web请求上下文
 */
public class RequestHolder {

    private static final ThreadLocal<RequestInfo> THREAD_LOCAL = new ThreadLocal<>();

    public static void setThreadLocal(RequestInfo requestInfo){
        THREAD_LOCAL.set(requestInfo);
    }

    public static RequestInfo getThreadLocal(){
        return THREAD_LOCAL.get();
    }

    public static void remove(){
        THREAD_LOCAL.remove();
    }



}
